# 关系运算符
# a = 3
# b = 2
# print(a == b)
# print(a > b)
# print(a < b)
# print(a >= b)
# print(a <= b)
# 支持这种写法
# print(4 > a + b > 1)  # 4>a+b&&a+b>1
# print(4 < a + b < 1)
# 字符串比较规则按字典序 比编码大小
# strcmp
# a = 'str'
# b = 'string'
# print(a <= b)
# 浮点数比较可能出错
# 因为浮点数存储有误差(科学计数法)
a = 0.1 + 0.2
b = 0.3
print(a)
print(0.1 + 0.2 == 3)
print(-0.000001 < a - b < 0.000001)  # 利用这种方式正确比较(站在工程的角度忽略误差)
